import { http } from "@/utils/http";
import type { HttpResult } from "@/utils/http/types";

export function queryTable(params) {
  return http.request<HttpResult>("get", "/admin/config/catelog/get/table", {
    params: params
  });
}

export function queryTree(params) {
  return http.request<HttpResult>("get", "/admin/config/catelog/get/tree", {
    params: params
  });
}

export function queryTreeTable(params) {
  return http.request<HttpResult>(
    "get",
    "/admin/config/catelog/get/treetable",
    {
      params: params
    }
  );
}

export function addObj(params) {
  return http.request<HttpResult>("post", "/admin/config/catelog/insert", {
    data: params
  });
}

export function updateObj(params) {
  return http.request<HttpResult>("post", "/admin/config/catelog/update", {
    data: params
  });
}

export function deleteObjs(ids) {
  return http.request<HttpResult>(
    "post",
    `/admin/config/catelog/delete/${ids}`
  );
}
